/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.MailboxManager;
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.mime.ParsedMessage;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class SaveChat
/*    */   extends CreateChat
/*    */ {
/*    */   private int mImapId;
/*    */   
/*    */   public SaveChat()
/*    */   {
/* 33 */     this.mOperation = MailboxOperation.SaveChat;
/*    */   }
/*    */   
/*    */   public SaveChat(int mailboxId, int chatId, String digest, int msgSize, int folderId, int flags, String[] tags) {
/* 37 */     super(mailboxId, digest, msgSize, folderId, flags, tags);
/* 38 */     this.mOperation = MailboxOperation.SaveChat;
/* 39 */     setMessageId(chatId);
/*    */   }
/*    */   
/*    */   public int getImapId() {
/* 43 */     return this.mImapId;
/*    */   }
/*    */   
/*    */   public void setImapId(int imapId) {
/* 47 */     this.mImapId = imapId;
/*    */   }
/*    */   
/*    */   protected String getPrintableData()
/*    */   {
/* 52 */     return super.getPrintableData() + ",imap=" + this.mImapId;
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException
/*    */   {
/* 57 */     out.writeInt(this.mImapId);
/* 58 */     super.serializeData(out);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException
/*    */   {
/* 63 */     this.mImapId = in.readInt();
/* 64 */     super.deserializeData(in);
/*    */   }
/*    */   
/*    */   public void redo() throws Exception
/*    */   {
/* 69 */     Mailbox mbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/*    */     
/* 71 */     ParsedMessage pm = new ParsedMessage(getMessageBody(), Long.valueOf(getTimestamp()), mbox.attachmentsIndexingEnabled());
/* 72 */     mbox.updateChat(getOperationContext(), pm, getMessageId());
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/SaveChat.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */